/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package managedBeans;

import ejb.ServicioTarea;
import entities.Responsable;
import entities.Tarea;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

/**
 *
 * @author Agapo
 */
@ManagedBean
@RequestScoped
public class TareaBean {

    @EJB
    private ServicioTarea st;
    
    private Tarea tarea;
    
    /** Creates a new instance of TareaBean */
    public TareaBean() {
    }
    @PostConstruct
    public void inicializar(){
        tarea=new Tarea();
    }
    public void guardar(){
        tarea.setResponsableCollection(new ArrayList<Responsable>() );
        st.altaTarea(tarea);
        
    }

    public List<Tarea> verTodas(){
        return st.verTarea();
    }
    public Tarea getTarea() {
        return tarea;
    }

    public void setTarea(Tarea tarea) {
        this.tarea = tarea;
    }
    
    
    
}
